{% extends "./inc_base.html" %}
{% block style %}
{%if category.pid !=0%}
{%column data="column",pid=category.pid%}
{%else%}
{%column data="column",cid=category.id%}
{%endif%}
<link rel="stylesheet" href="/static/assets/plugins/share/css/share.min.css">
<style>
    .active > .text{
        display: block !important;
    }
</style>
{% endblock %}
{% block content %}
<!--
PAGE HEADER

CLASSES:
.page-header-xs	= 20px margins
.page-header-md	= 50px margins
.page-header-lg	= 80px margins
.page-header-xlg= 130px margins
.dark			= dark page header

.shadow-before-1 	= shadow 1 header top
.shadow-after-1 	= shadow 1 header bottom
.shadow-before-2 	= shadow 2 header top
.shadow-after-2 	= shadow 2 header bottom
.shadow-before-3 	= shadow 3 header top
.shadow-after-3 	= shadow 3 header bottom
-->
<section class="page-header page-header-xs">
    <div class="container">
        {%if column|length>0%}
        <h1>{{category.title}}</h1>
        {%endif%}
        <!-- breadcrumbs -->
        <ol class="breadcrumb {%if column|length==0%} breadcrumb-inverse {%endif%}">
            <li><a href="/">首页</a></li>
            {%for val in breadcrumb %}
            <li><a href="{{val.url}}">{{val.title}}</a></li>
            {%if column|length==0%} <li>{{info.title}} </li>{%endif%}
            {% endfor %}
        </ol><!-- /breadcrumbs -->

        <!-- page tabs -->
        {%if column|length >0%}
        <ul class="page-header-tabs list-inline">
            <li {%if breadcrumb[0].id == category.id %}class="active"{%endif%}><a href="{{breadcrumb[0].url}}">全部</a></li>
            {%for val in column%}
            <li  {%if val.id == category.id %}class="active"{%endif%}><a href="{{val.url}}">{{val.name}}</a></li>
            {%endfor%}
        </ul>
        {%endif%}<!-- /page tabs -->
    </div>
</section>
<!-- /PAGE HEADER -->
<!-- -->
<section>
    <div class="container">

        <div class="row">

            <!-- LEFT -->
            <!-- LEFT -->
            <div class="col-md-3 col-sm-3">

                <!-- INLINE SEARCH -->
                <div class="inline-search clearfix margin-bottom-20">
                    <form action="/search" method="get" class="widget_search" target="_blank">
                        <input type="search" placeholder="请输入关键词..." id="q" name="q" class="serch-input">
                        <button type="submit">
                            <i class="fa fa-search"></i>
                        </button>
                    </form>
                </div>
                <!-- /INLINE SEARCH -->
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h2 class="panel-title"><a href="{{pinfo.name|get_url(pinfo.id)}}">{{pinfo.title}}</a></h2>
                    </div>
                    <div class="panel-body nopadding">
                        <!-- CATEGORIES -->
                        <div class="side-nav margin-bottom-10">
                            <ul class="list-group list-group-bordered list-group-noicon uppercase">
                                {%for val in ptree2%}
                                <li class="list-group-item {{'active' if (val.id == info.id or val.id == info.pid) }}">
                                    <a class="{{'dropdown-toggle' if val.children}}" href="{{val.name|get_url(val.id)}}">{{val.title}}</a>
                                    {% if val.children%}
                                    <ul>
                                        {%for v in val.children%}
                                        <li class="{{'active' if (v.id == info.id or v.id == info.pid) }}"><a href="{{v.name|get_url(v.id)}}">{{v.title}}</a></li>
                                        {%endfor%}
                                    </ul>
                                    {%endif%}
                                </li>
                                {%endfor%}
                            </ul>

                        </div>
                        <!-- /CATEGORIES -->
                    </div>
                </div>
            </div>

            <div class="col-md-9 col-sm-9">

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <a class="btn btn-default btn-xs pull-right">CmsWing</a>
                        <h2 class="panel-title">{{info.title}}</h2>
                    </div>
                    <div class="panel-body nopadding">
                        <!--页面内容钩子加载-->
                        {{content(pagehook)}}
                        <!--/页面内容钩子加载结束-->
                    </div>
                    {% rkeywords data ="tags",type="0",mod_id=info.model_id,id=info.id%}
                    {%if tags%}
                    <div class="panel-footer panel-footer-transparent">
                        <!-- TAGS -->

                        {%set color = ["btn-primary","btn-success","btn-info","btn-warning","btn-danger"]%}
                        {%for k in tags%}
                        <a href="{{k.url}}" class="btn {{color|random}} btn-xs relative">
                            {{k.keyname}}
                        </a>
                        {%endfor%}
                        <!-- /TAGS -->
                    </div>
                    {%endif%}
                    <div class="panel-footer panel-footer-transparent">
                    <div class="social-share" data-disabled="google,twitter,facebook,diandian" ></div>
                    </div>
                    <div class="panel-footer">
                        <ul class="pager nomargin">
                            {%if previous.id%}
                            <li class="previous"><a class="noborder" href="{{previous.name|get_url(previous.id)}}" title="{{previous.title}}">&larr; 上一篇:{{previous.title|block(20)}}</a></li>
                            {%endif%}
                            {%if next.id%}
                            <li class="next"><a class="noborder" href="{{next.name|get_url(next.id)}}" title="{{next.title}}">下一篇:{{next.title|block(20)}} &rarr;</a></li>
                            {%endif%}
                        </ul>
                    </div>
                    {{HOOK@documentDetailAfter|safe}}
                </div>


            </div>
        </div>


    </div>
</section>
<!-- / -->
{% endblock %}

{% block script %}
<script src="/static/assets/plugins/share/js/social-share.min.js"></script>
{% endblock %}
